 #ifndef CHART_H
 #define CHART_H

 #include <QtCharts/QChart>
 #include <QtCore/QTimer>

 QT_CHARTS_BEGIN_NAMESPACE
 class QSplineSeries;
 class QValueAxis;
 class QDateTimeAxis;
 QT_CHARTS_END_NAMESPACE

 class QGestureEvent;
 QT_CHARTS_USE_NAMESPACE

 class Chart: public QChart
 {
     Q_OBJECT
 public:
     explicit Chart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0,int a=0);
     virtual ~Chart();

     /**
      * @brief 处理计时器结束事件
      */

     int flag;
     QValueAxis *m_axisY;

 public slots:
     void handleTimeout(double res, int flag);
     void handleAxis(double lower, double upper);

 protected:
     bool sceneEvent(QEvent *event);

 private:
     bool gestureEvent(QGestureEvent *event);

 private:
     //计时器
     QTimer m_timer;
     //平滑曲线
     QSplineSeries *m_series;
    // QSplineSeries *m_series1;
     //图表名称
     QStringList m_titles;
     //自定义坐标轴
     QValueAxis *m_axisX;
    // QValueAxis *m_axisY1;
     qreal m_step;
     //实际读取数据
     qreal m_x;
     qreal m_y;
   //  qreal m_y1;
 };

 #endif /* CHART_H */
